package pages.MyComponents
{
	import mx.containers.Panel;
	import mx.controls.LinkButton;
	import mx.core.UIComponent;
	
	public class TitleBtuPanel extends Panel
	{
		public function TitleBtuPanel()
		{
		}
		
		private var _btu:UIComponent=new UIComponent();
		
		public function set btu(btu:UIComponent):void{
			this._btu=btu;
		}
		
		public function get btu():UIComponent{
			return this._btu;
		}
		//手动添加button 到头部
		override protected function createChildren():void{
			super.createChildren();
			titleBar.addChild(_btu);
		}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
			super.updateDisplayList(unscaledWidth,unscaledHeight);
			this._btu.setActualSize(_btu.getExplicitOrMeasuredWidth(),_btu.getExplicitOrMeasuredHeight());
			//绘制button 的位置
			this._btu.move(this.width-_btu.width-10,4);
		}
	}
}